unit uDZData;

interface

uses
  SysUtils,
  Classes,
  uDZPersistent;

type
  TConditionalOperator = (coAnd, coOr, coNot, coNone);
  TComparisonOperator = (coLess, coEqual, coGreater, coLike, coRegExp);
  TQueryCondition = class(TPersistent)
  private
    fFieldName: WideString;
    fComparison: TComparisonOperator;
    fValue: Variant;
    fConbination: TConditionalOperator;
    fConbinative: TQueryCondition;
    procedure SetConbinative(const Value: TQueryCondition);
  public
    constructor Create; override;
    destructor Destroy; override;
  published
    property FieldName: WideString read fFieldName write fFieldName;
    property Comparison: TComparisonOperator
      read fComparison write fComparison;
    property Value: Variant read fValue write fValue;
    property Conbination: TConditionalOperator
      read fConbination write fConbination;
    property Conbinative: TQueryCondition
      read fConbinative write SetConbinative;
  end;

  TDataQuery = class(TPersistent)
  private
    fTableName: WideString;
  published
    property TableName: WideString read fTableName write fTableName;
  end;  

implementation

{ TQueryCondition }

constructor TQueryCondition.Create;
begin
  inherited;
  
end;

destructor TQueryCondition.Destroy;
begin
  if (fConbinative <> nil) then fConbinative.Free;
  inherited;
end;

procedure TQueryCondition.SetConbinative(const Value: TQueryCondition);
begin
  if (fConbinative <> nil) then fConbinative.Free;
  fConbinative := Value;  
end;

end.
